﻿using System;
using System.Collections.Generic;
using Infinity.Common.Logger;
using QUT.Gppg;

namespace Infinity.Parser.Lexical
{
	public abstract class LexicalScanner : QUT.Gppg.AbstractScanner<Infinity.Parser.Syntax.ValueType, LexLocation>
	{
		protected bool yywrap()
		{
			return true;
		}

		public override void yyerror(string format, params object[] args)
		{
			DebugLogger.Instance.Error(string.Format("Message: {0}", format));
			Console.WriteLine("Message: {0}", format);
			ErrorList.Add(format);

			//base.yyerror(format, args);
		}

		protected List<string> _ErrorList = new List<string>();

		public List<string> ErrorList
		{
			get { return _ErrorList; }
		}
	}
}